import { defineStore } from 'pinia'
import { ref } from 'vue'

// 回复状态
export const useCommentStore = defineStore('news-comment', () => {
  // 响应状态
  const shouldUpdateComments = ref(false)

  // 改变状态
  const triggerUpdate = () => {
    shouldUpdateComments.value = true
  }

  // 重置状态
  const resetUpdateTrigger = () => {
    shouldUpdateComments.value = false
  }

  return {
    shouldUpdateComments,
    triggerUpdate,
    resetUpdateTrigger
  }
})
